
#include "libs.h"

bool isCollisionWithRect(const SDL_Rect &r1, const SDL_Rect &r2){
	if (r1.x > r2.x && r1.x > r2.x + r2.w){
		return false;
	} else if (r1.x < r2.x && r1.x + r1.w < r2.x){
		return false;
	} else if (r1.y > r2.y && r1.y > r2.y + r2.h){
		return false;
	} else if (r1.y < r2.y && r1.y + r1.h < r2.y){
		return false;
	}
	return true;
}